<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/productdata/ProductElementBOM.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/productdata/ProductElementBOM.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '元素数据',
                name: 'productdata/ProductElementBOM',
                url: "/ProductElementBOM/",
                sortName: "CreateDate",
                foreignKey:null
            });
            const editFormFields = ref({"ElementId":"","ElementName":"","CalculatingElement":"","ElementType":"","TargetProportion":"","UpperLimitIC":"","LowerLimitIC":"","UpperLimitStandard":"","LowerLimitStandard":"","Enable":""});
            const editFormOptions = ref([[{"title":"元素Id","field":"ElementId","disabled":true},
                               {"title":"元素名称","field":"ElementName","disabled":true},
                               {"title":"计算元素","field":"CalculatingElement"},
                               {"dataKey":"ElementType","data":[],"title":"元素类别","field":"ElementType","type":"select"}],
                              [{"title":"元素目标比例","field":"TargetProportion","type":"decimal"},
                               {"title":"元素内控上限","field":"UpperLimitIC","type":"decimal"},
                               {"title":"元素内控下限","field":"LowerLimitIC","type":"decimal"}],
                              [{"title":"元素标准上限","field":"UpperLimitStandard","type":"decimal"},
                               {"title":"元素标准下限","field":"LowerLimitStandard","type":"decimal"},
                               {"title":"是否启用","field":"Enable","type":"number"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProductId',title:'产品ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'ElementId',title:'元素Id',type:'string',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'ElementName',title:'元素名称',type:'string',width:110,readonly:true,align:'left',sort:true},
                       {field:'CalculatingElement',title:'计算元素',type:'string',width:110,align:'left'},
                       {field:'ElementType',title:'元素类别',type:'int',bind:{ key:'ElementType',data:[]},width:110,hidden:true,align:'left'},
                       {field:'NotDetectable',title:'不得检出标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'NoDSort',title:'不得检出排序',type:'int',width:110,hidden:true,align:'left'},
                       {field:'TargetProportion',title:'元素目标比例',type:'decimal',width:110,align:'left'},
                       {field:'UpperLimitIC',title:'元素内控上限',type:'decimal',width:110,align:'left'},
                       {field:'LowerLimitIC',title:'元素内控下限',type:'decimal',width:110,align:'left'},
                       {field:'UpperLimitStandard',title:'元素标准上限',type:'decimal',width:110,align:'left'},
                       {field:'LowerLimitStandard',title:'元素标准下限',type:'decimal',width:110,align:'left'},
                       {field:'Enable',title:'是否启用',type:'int',width:110,align:'left'},
                       {field:'CreateUserName',title:'添加人',type:'string',width:110,align:'left'},
                       {field:'CreateUserId',title:'添加人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateDate',title:'添加时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyUserName',title:'修改人',type:'string',width:110,align:'left'},
                       {field:'ModifyUserId',title:'修改人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'DeletionFlag',title:'删除标识',type:'int',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
